using HKB.Common;
using System;
using System.Data;
namespace HKB.Data.Dal
{
	public class ClientByPage
	{
		public int GetListCount(string strSQL)
		{
			object single = DbHelperSQL.GetSingle(strSQL.ToString());
			int result;
			if (single == null)
			{
				result = 0;
			}
			else
			{
				result = System.Convert.ToInt32(single);
			}
			return result;
		}
		public DataSet GetListPage(string strSQL, string row, int startIndex, int endIndex)
		{
			string text = string.Concat(new object[]
			{
				"SELECT * FROM ( ",
				strSQL,
				" ) as TT WHERE TT.",
				row,
				" between ",
				startIndex,
				" and ",
				endIndex
			});
			return Conn.Query(text.ToString(), new IDbDataParameter[0]);
		}
	}
}
